/**
 * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.babble.manage.service;

import com.babble.manage.entity.Img;
import com.babble.manage.vo.ImgVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.common.entity.MinioPolicy;
import org.springblade.core.mp.support.Query;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;


/**
 * 图片表 服务类
 *
 * @author Blade
 * @since 2021-11-21
 */
public interface IImgService extends IService<Img> {

	/**
	 * 自定义分页
	 *
	 * @param page
	 * @param img
	 * @return
	 */
	IPage<ImgVO> selectImgPage(IPage<ImgVO> page, ImgVO img);

	/**
	 * 上传图片-文件流
	 *
	 * @param pictureSortId 分类id
	 * @param imgFile       图片文件流
	 * @return
	 */
	Img upload(String pictureSortId, MultipartFile imgFile);

	/**
	 * 获取策略直传服务器图片
	 *
	 * @param pictureSortId 图片分类id
	 * @param fileName      文件名
	 * @param contentType   文件类型前缀
	 * @return
	 */
	MinioPolicy getPolicy(String pictureSortId, String fileName, String contentType);

	/**
	 * 获取分页发分类图片
	 *
	 * @param id    分类id
	 * @param query 分页条件
	 * @return
	 */
	IPage<Img> list(String id, Query query);

	/**
	 * 根据id删除图片
	 *
	 * @param id 图片id
	 */
	void delete(String id);

	/**
	 * 批量删除图片
	 * @param ids 图片id数组
	 */
	void deletes(List<String> ids);
}
